<?php

/**
 * AtkCharacter filter form base class.
 *
 * @package    aiontoolskit
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseAtkCharacterFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'name'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'class_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameClass'), 'add_empty' => true)),
      'faction_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameFaction'), 'add_empty' => true)),
      'level'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ambidextrous'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'aion_permalink'        => new sfWidgetFormFilterInput(),
      'main'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameWeaponMain'), 'add_empty' => true)),
      'sub'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameWeaponSub'), 'add_empty' => true)),
      'torso'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorT'), 'add_empty' => true)),
      'glove'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorG'), 'add_empty' => true)),
      'shoulder'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorS'), 'add_empty' => true)),
      'leg'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorL'), 'add_empty' => true)),
      'foot'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorF'), 'add_empty' => true)),
      'head'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorH'), 'add_empty' => true)),
      'ring1'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryRO'), 'add_empty' => true)),
      'ring2'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryRT'), 'add_empty' => true)),
      'necklace'              => new sfWidgetFormFilterInput(),
      'earring1'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryEO'), 'add_empty' => true)),
      'earring2'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryET'), 'add_empty' => true)),
      'belt'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryB'), 'add_empty' => true)),
      'maxHp'                 => new sfWidgetFormFilterInput(),
      'maxMp'                 => new sfWidgetFormFilterInput(),
      'bonusMp'               => new sfWidgetFormFilterInput(),
      'power'                 => new sfWidgetFormFilterInput(),
      'health'                => new sfWidgetFormFilterInput(),
      'agility'               => new sfWidgetFormFilterInput(),
      'accuracy'              => new sfWidgetFormFilterInput(),
      'knowledge'             => new sfWidgetFormFilterInput(),
      'will'                  => new sfWidgetFormFilterInput(),
      'walkSpeed'             => new sfWidgetFormFilterInput(),
      'runSpeed'              => new sfWidgetFormFilterInput(),
      'flySpeed'              => new sfWidgetFormFilterInput(),
      'attackSpeed'           => new sfWidgetFormFilterInput(),
      'bonusAttackSpeed'      => new sfWidgetFormFilterInput(),
      'evasion'               => new sfWidgetFormFilterInput(),
      'bonusEvasion'          => new sfWidgetFormFilterInput(),
      'block'                 => new sfWidgetFormFilterInput(),
      'bonusBlock'            => new sfWidgetFormFilterInput(),
      'parry'                 => new sfWidgetFormFilterInput(),
      'bonusParry'            => new sfWidgetFormFilterInput(),
      'mainHandAttack'        => new sfWidgetFormFilterInput(),
      'bonusMainHandAttack'   => new sfWidgetFormFilterInput(),
      'mainHandAccuracy'      => new sfWidgetFormFilterInput(),
      'bonusMainHandAccuracy' => new sfWidgetFormFilterInput(),
      'mainHandCritRate'      => new sfWidgetFormFilterInput(),
      'bonusMainHandCritRate' => new sfWidgetFormFilterInput(),
      'magicAccuracy'         => new sfWidgetFormFilterInput(),
      'bonusMagicAccuracy'    => new sfWidgetFormFilterInput(),
      'magicPower'            => new sfWidgetFormFilterInput(),
      'bonusMagicPower'       => new sfWidgetFormFilterInput(),
      'magicalResist'         => new sfWidgetFormFilterInput(),
      'bonusMagicResist'      => new sfWidgetFormFilterInput(),
      'physicalDef'           => new sfWidgetFormFilterInput(),
      'bonusPhyDef'           => new sfWidgetFormFilterInput(),
      'resistFire'            => new sfWidgetFormFilterInput(),
      'resistWater'           => new sfWidgetFormFilterInput(),
      'resistWind'            => new sfWidgetFormFilterInput(),
      'resistEarth'           => new sfWidgetFormFilterInput(),
      'subHandAttack'         => new sfWidgetFormFilterInput(),
      'bonusSubHandAttack'    => new sfWidgetFormFilterInput(),
      'subHandAccuracy'       => new sfWidgetFormFilterInput(),
      'bonusSubHandAccuracy'  => new sfWidgetFormFilterInput(),
      'subHandCritRate'       => new sfWidgetFormFilterInput(),
      'bonusSubHandCritRate'  => new sfWidgetFormFilterInput(),
      'created_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'name'                  => new sfValidatorPass(array('required' => false)),
      'class_id'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameClass'), 'column' => 'id')),
      'faction_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameFaction'), 'column' => 'id')),
      'level'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ambidextrous'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'aion_permalink'        => new sfValidatorPass(array('required' => false)),
      'main'                  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameWeaponMain'), 'column' => 'id')),
      'sub'                   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameWeaponSub'), 'column' => 'id')),
      'torso'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameArmorT'), 'column' => 'id')),
      'glove'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameArmorG'), 'column' => 'id')),
      'shoulder'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameArmorS'), 'column' => 'id')),
      'leg'                   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameArmorL'), 'column' => 'id')),
      'foot'                  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameArmorF'), 'column' => 'id')),
      'head'                  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameArmorH'), 'column' => 'id')),
      'ring1'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameAccessoryRO'), 'column' => 'id')),
      'ring2'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameAccessoryRT'), 'column' => 'id')),
      'necklace'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'earring1'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameAccessoryEO'), 'column' => 'id')),
      'earring2'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameAccessoryET'), 'column' => 'id')),
      'belt'                  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameAccessoryB'), 'column' => 'id')),
      'maxHp'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'maxMp'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMp'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'power'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'health'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'agility'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'accuracy'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'knowledge'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'will'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'walkSpeed'             => new sfValidatorPass(array('required' => false)),
      'runSpeed'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'flySpeed'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'attackSpeed'           => new sfValidatorPass(array('required' => false)),
      'bonusAttackSpeed'      => new sfValidatorPass(array('required' => false)),
      'evasion'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusEvasion'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'block'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusBlock'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'parry'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusParry'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mainHandAttack'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMainHandAttack'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mainHandAccuracy'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMainHandAccuracy' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mainHandCritRate'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMainHandCritRate' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magicAccuracy'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMagicAccuracy'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magicPower'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMagicPower'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magicalResist'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusMagicResist'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'physicalDef'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusPhyDef'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'resistFire'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'resistWater'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'resistWind'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'resistEarth'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subHandAttack'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusSubHandAttack'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subHandAccuracy'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusSubHandAccuracy'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subHandCritRate'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bonusSubHandCritRate'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('atk_character_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'AtkCharacter';
  }

  public function getFields()
  {
    return array(
      'id'                    => 'Number',
      'name'                  => 'Text',
      'class_id'              => 'ForeignKey',
      'faction_id'            => 'ForeignKey',
      'level'                 => 'Number',
      'ambidextrous'          => 'Boolean',
      'aion_permalink'        => 'Text',
      'main'                  => 'ForeignKey',
      'sub'                   => 'ForeignKey',
      'torso'                 => 'ForeignKey',
      'glove'                 => 'ForeignKey',
      'shoulder'              => 'ForeignKey',
      'leg'                   => 'ForeignKey',
      'foot'                  => 'ForeignKey',
      'head'                  => 'ForeignKey',
      'ring1'                 => 'ForeignKey',
      'ring2'                 => 'ForeignKey',
      'necklace'              => 'Number',
      'earring1'              => 'ForeignKey',
      'earring2'              => 'ForeignKey',
      'belt'                  => 'ForeignKey',
      'maxHp'                 => 'Number',
      'maxMp'                 => 'Number',
      'bonusMp'               => 'Number',
      'power'                 => 'Number',
      'health'                => 'Number',
      'agility'               => 'Number',
      'accuracy'              => 'Number',
      'knowledge'             => 'Number',
      'will'                  => 'Number',
      'walkSpeed'             => 'Text',
      'runSpeed'              => 'Number',
      'flySpeed'              => 'Number',
      'attackSpeed'           => 'Text',
      'bonusAttackSpeed'      => 'Text',
      'evasion'               => 'Number',
      'bonusEvasion'          => 'Number',
      'block'                 => 'Number',
      'bonusBlock'            => 'Number',
      'parry'                 => 'Number',
      'bonusParry'            => 'Number',
      'mainHandAttack'        => 'Number',
      'bonusMainHandAttack'   => 'Number',
      'mainHandAccuracy'      => 'Number',
      'bonusMainHandAccuracy' => 'Number',
      'mainHandCritRate'      => 'Number',
      'bonusMainHandCritRate' => 'Number',
      'magicAccuracy'         => 'Number',
      'bonusMagicAccuracy'    => 'Number',
      'magicPower'            => 'Number',
      'bonusMagicPower'       => 'Number',
      'magicalResist'         => 'Number',
      'bonusMagicResist'      => 'Number',
      'physicalDef'           => 'Number',
      'bonusPhyDef'           => 'Number',
      'resistFire'            => 'Number',
      'resistWater'           => 'Number',
      'resistWind'            => 'Number',
      'resistEarth'           => 'Number',
      'subHandAttack'         => 'Number',
      'bonusSubHandAttack'    => 'Number',
      'subHandAccuracy'       => 'Number',
      'bonusSubHandAccuracy'  => 'Number',
      'subHandCritRate'       => 'Number',
      'bonusSubHandCritRate'  => 'Number',
      'created_at'            => 'Date',
      'updated_at'            => 'Date',
    );
  }
}
